package com.tangw.management.service;

import java.util.List;

import org.springframework.data.domain.Sort;

import com.sun.istack.internal.Nullable;
import com.tangw.management.model.User;

/**
 * 
 * @author TangW
 * @version 1.0
 *
 */
public interface UserService {

	/**
	 * list user
	 * 
	 * @param sort
	 * @return
	 */
	public List<User> listUser(@Nullable Sort sort);

	/**
	 * count user
	 * 
	 * @return
	 */
	public Long countUser();

	/**
	 * find user by id
	 * 
	 * @param id
	 * @return
	 */
	public User findUserById(Integer id);

	/**
	 * find user by username
	 * 
	 * @param username
	 * @return
	 */
	public User findUserByUsername(String username);

	/**
	 * create user
	 * 
	 * @param user
	 * @return
	 */
	public User createUser(User user);

	/**
	 * update user
	 * 
	 * @param user
	 * @return
	 */
	public int updateUser(User user);

	/**
	 * delete user by id
	 * 
	 * @param id
	 */
	public void deleteById(Integer id);

}
